﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XiTongAddDept.aspx.cs" Inherits="PropertyAppraisal.SystemManage.AddDept" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
   <link href="../jquery-easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" />
   <link href="../easyui/easyui/1.3.2/themes/icon.css" rel="stylesheet" />
    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery-1.7.2-min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/easyloader.js"></script>
    <script src="../easyui/easyui/1.3.2/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
    <div class="demo-info">
        <div class="demo-tip icon-tip"></div>
        <%--<div>Fill the form and submit it.</div>--%>
    </div>
    <div style="margin: 0;"></div>
    <form id="form1" runat="server">
        <div class="easyui-panel" fit="true" style="border: none;">
            <div style="margin-left: 30px;" id="ff">
                <div>
                        <iframe width="0" height="0" src="../SessionKeeper.aspx"></iframe>   
                    <span>添加部门基本信息：</span>
                </div>
                <br />
                <br />
                <div>
                    <table>
                        <tr>
                            <td>部门名称：</td>
                            <td style="padding-left: 50px;">
                                <input id="name" class="easyui-validatebox" missingMessage="必填" type="text" name="linkmen" data-options="required:true" style="width: 800px;" placeholder="请输入部门名称" maxlength="20" /></td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>备注：</td>
                            <td id="beizhu" style="padding-left: 50px;">
                                <textarea name="desc" style="height: 60px; width: 800px;" placeholder="请输入部门备注信息" maxlength="200"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>是否启用：</td>
                            <td style="padding-left: 50px;">
                                <input type="radio" value="0" name="sex"  />启用
                                <input type="radio" value="1" name="sex" />停用
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                            <td></td>
                        </tr>
                    </table>
                </div>
                <div style="text-align: center; padding: 5px">
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btn">提交</a>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>
    $('#btn').bind('click', function () {
        var name = $("#name").val();
        var state = $(":radio:checked").val();
        var beizhu = $("#beizhu").val();
        $.ajax({
            type: "post",
            url: "XiTongAddDept.aspx/AddDep",
            data: "{'name':'" + name + "','beizhu':'" + beizhu + "','state':'" + state + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            async: false,
            success: function (obj) {

                if (obj) {

                    $.messager.alert('提示信息', '增加成功', 'info', function () {

                        parent.removeTab();
                        parent.addTab("部门管理", "/SystemManage/XiTongDep.aspx", "icon-chart-organisation", true);

                    });
                }
                else {
                    $.messager.alert('提示信息', '增加失败');
                }
            }
        })
    });
</script>
